﻿using System;

namespace API.Cryptsy.Entity
{
    public class Order
    {

        public long OrderID
        {
            get
            {
                if (_orderID == null)
                    throw new InvalidOperationException();
                else
                    return _orderID.Value;
            }
            set
            { _orderID = value; }
        } private long? _orderID =  null;

        public int MarketID
        {
            get
            {
                if (_marketID == null)
                    throw new InvalidOperationException();
                else
                    return _marketID.Value;
            }
            set
            { _marketID = value; }
        } private int? _marketID = null;

        public DateTime Created
        {
            get
            {
                if (_created == null)
                    throw new InvalidOperationException();
                else
                    return _created.Value;
            }
            set
            { _created = value; }
        } private DateTime? _created = null;

        public OrderType OrderType
        {
            get
            {
                if (_orderType == null)
                    throw new InvalidOperationException();
                else
                    return _orderType.Value;
            }
            set
            { _orderType = value; }
        } private OrderType? _orderType = null;

        public double Price
        {
            get
            {
                if (_price == null)
                    throw new InvalidOperationException();
                else
                    return _price.Value;
            }
            set
            { _price = value; }
        } public double? _price = null;

        public double Quantity
        {
            get
            {
                if (_quantity == null)
                    throw new InvalidOperationException();
                else
                    return _quantity.Value;
            }
            set
            { _quantity = value; }
        } public double? _quantity = null;

        public double Total
        {
            get
            {
                if (_total == null)
                    throw new InvalidOperationException();
                else
                    return _total.Value;
            }
            set
            { _total = value; }
        } private double? _total = null;

        public double Orig_Quantity
        {
            get
            {
                if (_origQuantity == null)
                    throw new InvalidOperationException();
                else
                    return _origQuantity.Value;
            }
            set
            { _origQuantity = value; }
        } private double? _origQuantity = null;
    }
}
